#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int mod = 1e9 + 7;

int gcd(int a, int b)
{
    return b ? gcd(b, a % b) : a;
}

ll qmi(ll a, ll b)
{
    ll res = 1;
    while(b)
    {
        res = res * a % mod;
        b >>= 1;
        a = a * a % mod;
    }
    return res;
}

int main()
{
    string s;
    cin >> s;
    int n = s.size();
    for(int i = (n + 1) / 2; i < n - 1; i++)
    {
        if(s.substr(0, i) == s.substr(n - i))
        {
            cout << "NO" << endl;
            cout << s.substr(0, i) << endl;
            return 0;
        }
    }
    cout << "NO" << endl;
    return 0;
}